﻿using MQTT.Server.Attributes;
using MQTTnet;

namespace MQTT.Server.Handlers
{
    [TopicAttribute("Hello")]
    public class HelloHandler : TopicHandlerBase
    {

        [TopicAttribute("Word")]
        public async Task Word()
        {
            await Console.Out.WriteLineAsync(ApplicationMessage.ConvertPayloadToString());
        }

        [TopicAttribute("Word/${number}")]
        public async Task Word(string number)
        {
            await Console.Out.WriteLineAsync(number);
            await Console.Out.WriteLineAsync(ApplicationMessage.ConvertPayloadToString());
        }
    }
}
